/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "pyfntbprogres")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Pyfntbprogres.findAll", query = "SELECT p FROM Pyfntbprogres p"),
    @NamedQuery(name = "Pyfntbprogres.findByPyfntbprogresid", query = "SELECT p FROM Pyfntbprogres p WHERE p.pyfntbprogresid = :pyfntbprogresid")})
public class Pyfntbprogres implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "pyfntbprogresid")
    private Integer pyfntbprogresid;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pyfntbprogresid")
    private Collection<Pyfntbpreevid> pyfntbpreevidCollection;
    @JoinColumn(name = "pyfntbprodresid", referencedColumnName = "pyfntbprodresid")
    @ManyToOne(optional = false)
    private Pyfntbprodres pyfntbprodresid;
    @JoinColumn(name = "pyfntbpoaprogid", referencedColumnName = "pyfntbpoaprogid")
    @ManyToOne(optional = false)
    private Pyfntbpoaprog pyfntbpoaprogid;

    public Pyfntbprogres() {
    }

    public Pyfntbprogres(Integer pyfntbprogresid) {
        this.pyfntbprogresid = pyfntbprogresid;
    }

    public Integer getPyfntbprogresid() {
        return pyfntbprogresid;
    }

    public void setPyfntbprogresid(Integer pyfntbprogresid) {
        this.pyfntbprogresid = pyfntbprogresid;
    }

    @XmlTransient
    public Collection<Pyfntbpreevid> getPyfntbpreevidCollection() {
        return pyfntbpreevidCollection;
    }

    public void setPyfntbpreevidCollection(Collection<Pyfntbpreevid> pyfntbpreevidCollection) {
        this.pyfntbpreevidCollection = pyfntbpreevidCollection;
    }

    public Pyfntbprodres getPyfntbprodresid() {
        return pyfntbprodresid;
    }

    public void setPyfntbprodresid(Pyfntbprodres pyfntbprodresid) {
        this.pyfntbprodresid = pyfntbprodresid;
    }

    public Pyfntbpoaprog getPyfntbpoaprogid() {
        return pyfntbpoaprogid;
    }

    public void setPyfntbpoaprogid(Pyfntbpoaprog pyfntbpoaprogid) {
        this.pyfntbpoaprogid = pyfntbpoaprogid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pyfntbprogresid != null ? pyfntbprogresid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pyfntbprogres)) {
            return false;
        }
        Pyfntbprogres other = (Pyfntbprogres) object;
        if ((this.pyfntbprogresid == null && other.pyfntbprogresid != null) || (this.pyfntbprogresid != null && !this.pyfntbprogresid.equals(other.pyfntbprogresid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Pyfntbprogres[ pyfntbprogresid=" + pyfntbprogresid + " ]";
    }
    
}
